package com.bw.mvvm_common.network;

public class HttpFactory {

    private static HttpInterface token,sign,ts,upload;

    public static HttpInterface create(HttpEnum httpEnum){
        switch (httpEnum){
            case Upload:
                if (upload == null){
                    upload = new UploadImpl();
                }
                return upload;
            case Token:
                if (token == null)
                    token = new TokenImpl();
                return token;
            case Sign:
                if (sign == null)
                    sign = new SignImpl();
                return sign;
            default:
                if (ts == null)
                    ts = new TokenSignImpl();
                return ts;
        }
    }

}
